package cn.com.surker.material.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 领用材料记录
 * </p>
 *
 * @author admin
 * @since 2023-07-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class MaterialOutboundItem implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

	/**
	 * 出库记录id
	 */
	private Long outboundId;

	@TableField(exist = false)
	private MaterialOutbound materialOutbound;

    /**
     * 材料id
     */
	@NotNull(message = "请选择材料")
    private Long materialId;

	/**
	 * 材料名称
	 */
	@TableField(exist = false)
	private MaterialInfo materialInfo;

    /**
     * 消耗仓位
     */
	@NotNull(message = "请选择入库仓位")
    private Long warehouseId;

	/**
	 * 公司id
	 */
    private Long orgId;

	@TableField(exist = false)
    private String orgName;

	/**
	 * 部门id
	 */
	private Long deptId;

    /**
	 * 仓位名称
	 */
	@TableField(exist = false)
	private String warehouseName;

    /**
     * 耗用数量
     */
	@NotNull(message = "请输入领用数量")
    private BigDecimal count;

	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
	private Date outDate;

    /**
     * 领用类型(0：领用、1：离职转入、2：入职转入、3：流程转入、4：资产清理)
     */
	private Integer type;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 状态(0:启用1:禁用)
     */
    private Integer status;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建人员
     */
    private Long creater;

    /**
     * 修改时间
     */
	@TableField(fill = FieldFill.UPDATE,update="now()")
    private Date updateTime;

    /**
     * 修改人员
     */
    private Long updater;

    /**
     * 备注
     */
    private String remarks;

	/**
	 * 修改变动记录
	 */
	private String changeLogs;
}
